package com.medical.client.controller.utils;

import javafx.scene.control.Alert;
import javafx.scene.control.DialogPane;

/**
 * @ClassName: AlertUtil
 * @Description: TODO
 * @Author: JackyLee
 * @Date: 2024/6/23 21:38
 **/
public class AlertUtil {
    // 私有构造函数，防止工具类被实例化
    private AlertUtil() {
    }

    /**
     * 显示信息提示框的静态方法。
     *
     * @param content 提示框的内容文本
     */
    public static void showInformationAlert(String content) {
        // 创建 Alert
        Alert alert = new Alert(Alert.AlertType.INFORMATION, content);
        alert.setTitle("信息提示！");
        alert.setHeaderText("提示");

        // 获取对话框的DialogPane并设置样式
        DialogPane dialogPane = alert.getDialogPane();
        dialogPane.getStyleClass().add("custom-styled-alert");
        dialogPane.setStyle("-fx-font-size: 14px;" +
                "-fx-background-color: #f0f0f0;" +
                "-fx-border-color: #d0d0d0;" +
                "-fx-border-width: 1;" +
                "-fx-border-style: solid;");

        // 显示对话框
        alert.showAndWait();
    }
}
